home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XAAES_S.ZIP / XAAES / CLOSWIDG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-27  |  1.4 KB  |  64 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. #include <OSBIND.H>
  9. #include <VDI.H>
  10. #include "XA_TYPES.H"
  11. #include "XA_DEFS.H"
  12. #include "XA_GLOBL.H"
  13. #include "KERNAL.H"
  14. #include "K_DEFS.H"
  15. #include "GRAF_MOU.H"
  16. #include "MESSAGES.H"
  17. #include "C_WINDOW.H"
  18. #include "RECTLIST.H"
  19. #include "ALL_WIDG.H"
  20. #include "STD_WIDG.H"
  21.  
  22. /*======================================================
  23.     CLOSE WIDGET BEHAVIOUR
  24. ========================================================*/
  25. /* Display the closer widget */
  26. short display_close_widget(XA_WINDOW *wind, XA_WIDGET *widg)
  27. {
  28.     short x,y;
  29.  
  30.     rp_2_ap(wind, widg, &x, &y);
  31.  
  32.     if (widg->stat==XAW_PLAIN)
  33.         display_widget_bitmap(x, y, widget_bitmap_close);
  34.     else
  35.         display_widget_bitmap(x, y, widget_bitmap_close_s);
  36.         
  37.     return TRUE;
  38. }
  39.  
  40. /* 
  41.  Default close widget behaviour - just send a WM_CLOSED message to the client that
  42.  owns the window.
  43. */
  44. short click_close(XA_WINDOW *wind, XA_WIDGET *widg)
  45. {
  46.     if (wind->active_widgets&NO_MESSAGES)    /* Just close these windows, they can handle it.... */
  47.     {
  48.         v_hide_c(V_handle);
  49.  
  50.         display_windows_below(wind);
  51.         send_wind_to_bottom(wind);
  52.  
  53.         v_show_c(V_handle,1);
  54.         
  55.         delete_window(wind);
  56.         
  57.         return FALSE;    /* Don't redisplay in the do_widgets() routine */
  58.     }
  59.     
  60.     send_app_message(wind->owner, WM_CLOSED, 0, wind->handle, 0, 0, 0, 0);
  61.  
  62.     return TRUE; /* Redisplay.... */
  63. }
  64.